<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //console.log(Math.random());
    //获取1-5的随机数
   /* function getRandom(min,max) {
        return Math.floor(Math.random() * (max - min + 1) + min);
    }
    console.log(getRandom(1,5));
  */
 /*
    let arr = ['a','c','e','f','fe','degf'];
    let array = new Array('c','fe','degf');
    //arr[0];   
    //0-arr.length-1
    let RanIndex = Math.floor(Math.random() * (arr.length))
    console.log(arr[RanIndex]);
*/

    //随机点名，点过的名字不能重复，如果全部点完名退出点名并提示用户
    let arr = ['张三','里斯','杨光','赵战欧'];
    let array = new Array('里斯','杨光','赵战欧');
    let RanIndex = Math.floor(Math.random() * (arr.length))
    console.log(arr[RanIndex]);
</script>
</html>